﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SMSSnew.DATA;

namespace SMSSnew.UI
{
    public partial class ChangeUnamePwrd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        //protected void Butchange_Click(object sender, EventArgs e)
        //{
        //    profileDA myprofileDA = new profileDA();
        //    myprofileDA.updateprofile(NewPword.Text, txtNewUname.Text);
        //}

        protected void Button1_Click(object sender, EventArgs e)
        {
            profileDA myprofileDA = new profileDA();
            if (txtNewUname.Text == txtNewUname1.Text && txtNewPword.Text == txtNewPword1.Text)
            {
                myprofileDA.updateprofile(txtNewPword.Text, txtNewUname.Text);

                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('User name and pass word changed successfully. !');", true);
                Response.Redirect("profile.aspx");

            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert('new user name and passs word are not valied. Please Try Again !');", true);
                txtNewUname.Text = "";
                txtNewUname1.Text = "";
                txtNewPword.Text = "";
                txtNewPword1.Text = "";

            }

            //if ( )

            //{
            //}
        }


    }
}
